import axios from '../utils/request'
// process.NODE_ENV.env 什么是环境变量
// 就是一个变量 在每个环境下值不同而已
function getShopList(query) {
    return axios.get(`/api/shop`, { params: query })
}
function getShopDetail(id) {
    return axios.get(`/api/shop/${id}`)
}
function addToCart(body) {
    return axios.post(`/api/cart`, body)
}
function getCartList(query) {
    return axios.get(`/api/cart`, { params: query })
}
function setCartCount(body) {
    return axios.put(`/api/cart`, body)
}
function delCartById(id) {
    return axios.delete('/api/cart/' + id)
}

export default {
    getShopList,
    getShopDetail,
    addToCart,
    getCartList,
    setCartCount,
    delCartById,
}